<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <h1 class="error-title">{{ t('error.notFound') }}</h1>
      <p class="error-description">{{ t('error.notFoundDescription') }}</p>
      <div class="action-buttons">
        <a-button type="primary" size="large" @click="goBack">
          {{ t('error.goBack') }}
        </a-button>
        <a-button size="large" @click="goHome" class="ml-md">
          {{ t('error.goHome') }}
        </a-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'

// 定义组件名称
defineOptions({
  name: 'NotFound'
})

// 路由
const router = useRouter()

// 国际化
const { t } = useI18n()

// 返回上一页
const goBack = () => {
  router.go(-1)
}

// 返回首页
const goHome = () => {
  router.push('/')
}
</script>

<style lang="scss" scoped>
.not-found-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: $bg-color;
  
  .not-found-content {
    text-align: center;
    padding: $spacing-xl;
    
    .error-code {
      font-size: 120px;
      font-weight: bold;
      color: $primary-color;
      line-height: 1.2;
      margin-bottom: $spacing-lg;
    }
    
    .error-title {
      font-size: $font-size-xl * 1.5;
      color: $text-color-primary;
      margin-bottom: $spacing-md;
    }
    
    .error-description {
      font-size: $font-size-lg;
      color: $text-color-secondary;
      margin-bottom: $spacing-xl;
    }
    
    .action-buttons {
      display: flex;
      justify-content: center;
      gap: $spacing-md;
    }
  }
}

// 响应式调整
@include responsive(xs) {
  .not-found-container {
    .not-found-content {
      padding: $spacing-lg;
      
      .error-code {
        font-size: 80px;
      }
      
      .error-title {
        font-size: $font-size-xl;
      }
      
      .error-description {
        font-size: $font-size-base;
      }
    }
  }
}
</style> 